import FormHook from "@/hook/formHook";
import { GeneraDataType } from "@/interface";
// import { Form } from "ant-design-vue";
// import { ref } from "vue";
export default function OperationHook(state: GeneraDataType) {
  const { emit, puppeteerSearchForm } = state;
  const { initValueToUndefined, resetFields } = FormHook({ formState: puppeteerSearchForm });
  // const useForm = Form.useForm;
  // const { resetFields } = useForm(puppeteerSearchForm, ref<any>({}));
  const searchHandle = () => {
    emit("search");
  };
  const resetHandle = () => {
    resetFields();
    puppeteerSearchForm.value = initValueToUndefined(puppeteerSearchForm.value);
    emit("search");
  };
  return {
    searchHandle,
    resetHandle
  };
}
